package cn.edu.gxu.xingjian.teacherassistant.web;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.management.Query;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import cn.edu.gxu.xingjian.teacherassistant.domain.Curriculum;
import cn.edu.gxu.xingjian.teacherassistant.domain.Teacher;

@RequestMapping("/teacher/Course/**")
@Controller
public class CourseController {

    @RequestMapping(method = RequestMethod.POST, value = "{id}")
    public void post(@PathVariable Long id, ModelMap modelMap, HttpServletRequest request, HttpServletResponse response) {}

    @RequestMapping("list")
    public String mycourse(@ModelAttribute("teacher") Teacher teacher ,Model uiModel) {
    	//int accountId=AccountPassword.findAccountPassword(id)''
//    	AccountPassword accountPassword = AccountPassword
    	int accountPasswordId = 1;
    	int rows = 0;
    	
    	int teacherId=1;
    	Teacher.countTeachers();
    	Teacher teacher1 = Teacher.findTeacher((long) teacherId);
        uiModel.addAttribute("teacher", teacher1);
    	    	
    	return "teacher/Course/list";
    }
    
    @RequestMapping("create")
    public String showcurriculum(@ModelAttribute("curriculum") Curriculum curriculum, Model uiModel){

		
    	return "teacher/Course/create";
    }
    
    @RequestMapping
    public String index() {
        return "teacher/Course/index";
    }
}
